package com.zero2oneblog.controller;

import com.zero2oneblog.entity.UserRole;
import com.zero2oneblog.mapper.UserRoleMapper;
import com.zero2oneblog.service.IUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liangjiu
 * @since 2024-01-08
 */
//@Controller
//@RequestMapping("/zero2oneblog/userRole")
@RestController
public class UserRoleController {

    @Autowired
    private UserRoleMapper userRoleMapper;

    @Autowired
    private IUserRoleService userRoleService;

    @GetMapping("/public/getuserrole")
    public List<UserRole> test() {
//        return userRoleMapper.selectOneToMany(null);
        return userRoleService.selectOneToMany();
    }

}
